import java.util.*;
public class  Main{

    public static void main(String[] args) {
        Scanner reader = new Scanner(System.in);
        int a = reader.nextInt();
        int b = reader.nextInt();

        System.out.println(gcd(a,b));
        System.out.println(lcm(a,b));
        reader.close();
    }

    public static int gcd( int m, int n ) //求最大公约数
    {
        int div;
        div= Math.min(m, n);
        while(m%div!=0||n%div!=0)
        { div--;}
        return div;
    }
    public static int lcm ( int m, int n ) //求最小公倍数
    {
        int mul;
        mul= Math.max(m, n);
        while (mul%m!=0||mul%n!=0)
        {mul=mul+mul;}

        return mul;
    }


}
